/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;

/**
 *
 * @author enrico
 */
public class MenuPulsante extends Label {
    private String nome;
    
    public MenuPulsante(String nome, String immagine) {
        this.nome = nome;
        this.setText(nome);
        this.setGraphic(new ImageView(new Image(getClass().getResourceAsStream(immagine))));
        this.setMinWidth(160);
        
    }
    
    public boolean clickedOnMe(String nome) {
        if (nome.equalsIgnoreCase(this.nome)) {
            // Cambio classe e quindi colore
            this.setId("pulsanteCliccato");
            return true;
        } else {
            this.setId("");
            return false;
        }
    }
}
